﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.Repository.Domain;

namespace OpenAuth.Mvc.Controllers.AUTH
{
    public class BuilderTableController : BaseController
    {
        private BuilderTableApp _app;

        public BuilderTableController(IAuth auth, BuilderTableApp app) : base(auth)
        {
            _app = app;
        }
        public IActionResult Index()
        {
            return View();
        }
        public async Task<string> Load(QueryBuilderTableListReq request)
        {
            var data = new TableResp<BuilderTable>();
          //  var data = new TableData();
            data = await _app.Load(request);
            return JsonHelper.Instance.Serialize(data);
        }
    }
}